import request from '@/utils/request'

// 分类列表
export const classifyListApi = () => request.get(`category`)

// 修改商品分类状态
export const updataClassifyStateApi = (id:number,status:number) => request.post(`category/${id}/update_status`,{status})

// 增加商品分类
export const addCategoryApi = (name : string) => request.post(`category`,{name})

// 修改商品分类
export const updataClassifyApi = (id:number,name:string) => request.post(`category/${id}`,{name})

// 删除商品分类
export const removeClassifyApi = (id:number) => request.post(`category/${id}/delete`)

// 分类关联产品列表
export const app_category_itemApi = (id:number) => request.get(`app_category_item/list?category_id=${id}`)

// 删除关联产品
export const removeApp_category_itemApi = (id:number) => request.post(`app_category_item/${id}/delete`)